<?php
namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use DB;
class AdvertThumpModel extends Model
{
	// 广告图片model
	protected $table='advert_img';
    // protected $primaryKey='id';
    protected $guarded=[];
    public $timestamps=false;

    const IS_YES = 1; // ture
    const IS_NOT  = 0; // false
    public function getIsShow( $key = null )
    {
        $array = [
            self::IS_YES  => '是',
            self::IS_NOT   => '否'
        ];
        if( $key !== null )
        {
            return array_key_exists($key, $array ) ? $array[$key] : $array[self::IS_YES];
        }
        return $array;
    }
    public function isDelete( $key = null )
    {
        $array = [
            self::IS_YES  => '是',
            self::IS_NOT   => '否'
        ];
        if( $key !== null )
        {
            return array_key_exists($key, $array ) ? $array[$key] : $array[self::IS_YES];
        }
        return $array;
    }


}